package processes.concurrentInputProcess;

import os.MiniOS;
import os.MiniProcess;
import os.MiniThread;

public class ConcurrentInputProcessThread1 extends MiniThread
{

	public ConcurrentInputProcessThread1(MiniProcess process, String tid)
	{
		super(process, tid);
		description = "Capitalizes input";
	}

	@Override
	public void passThreadArguments(Object[] arguments)
	{
	}

	@Override
	public void run()
	{
		isExcecutionStopped();
		MiniOS
				.getInstance()
				.createThread(
						getProcessId(),
						"processes.concurrentInputProcess.ConcurrentInputProcessThread2",
						null).start();
		isExcecutionStopped();
		MiniThread t = MiniOS
				.getInstance()
				.createThread(
						getProcessId(),
						"processes.concurrentInputProcess.ConcurrentInputProcessThread3",
						null);t.start();
		isExcecutionStopped();
//		MiniOS.getInstance().join(this, t);
//		isExcecutionStopped();
//		System.out.println("5laaaaaaaaaaaaaaas");
		while (true)
		{
			MiniOS.getInstance().inputRequest(this);
			isExcecutionStopped();
			MiniOS.getInstance().outputRequest(this, getInput().toUpperCase());
			isExcecutionStopped();
		}
	}

}
